﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Drive.DbAccess
{
    public class ColumnMapping
    {
        public ColumnMapping()
        {
            this.SrcIndex = -1;
            this.DstIndex = -1;
        }
        public string Src { get; set; }
        public int SrcIndex { get; set; }
        public string Dst { get; set; }
        public int DstIndex { get; set; }

        public bool Enabled { get; set; }
        public string Sql { get; set; }
        public string FixedValue { get; set; }
        public bool UseFixedValue { get; set; }
        public bool ReplaceNull { get; set; }
        public bool FixedValueAI { get; set; }

        public override string ToString()
        {
            if (!string.IsNullOrEmpty(Sql))
                return $"SQL ==> {this.Dst}";
            if (UseFixedValue)
                return $"VALUE({this.FixedValue}) ==> {this.Dst}";
            return this.Src + " ==> " + this.Dst;
        }
    }
}
